package org.zoomdev.zoom.dao.ddl;

import org.zoomdev.zoom.dao.meta.TableMeta;

import java.util.List;

public interface DatabaseBuilder {


    DatabaseBuilder dropIfExists(String table);

    DatabaseBuilder createIfNotExists(String table);

    DatabaseBuilder createIfNotExists(TableMeta table);

    DatabaseBuilder createIfNotExists(Class<?> table);

    DatabaseBuilder dropIfExists(Class<?> table);

    DatabaseBuilder createTable(String table);

    // comment current context is table, for table, current context is column, for column
    DatabaseBuilder comment(String comment);

    // add column
    DatabaseBuilder add(String column);

    DatabaseBuilder autoIncrement();

    DatabaseBuilder index();

    DatabaseBuilder primaryKey();

    DatabaseBuilder uniqueKey();

    DatabaseBuilder notNull();


    /**
     * varchar
     *
     * @param size
     * @return
     */
    DatabaseBuilder varchar(int size);   //varchar

    /**
     * char
     *
     * @param size
     * @return
     */
    DatabaseBuilder charString(int size);

    DatabaseBuilder smallInt();

    DatabaseBuilder smallIntUnsigned();

    DatabaseBuilder text();

    DatabaseBuilder timestamp();

    DatabaseBuilder datetime();

    DatabaseBuilder date();

    DatabaseBuilder integer();

    DatabaseBuilder mediumint();

    DatabaseBuilder integerUnsigned();

    DatabaseBuilder bigInt();

    DatabaseBuilder bigIntUnsigned();

    DatabaseBuilder tinyInt();

    DatabaseBuilder tinyIntUnsigned();


    DatabaseBuilder tinyblob();

    DatabaseBuilder blob();

    DatabaseBuilder mediumBlob();

    DatabaseBuilder clob();

    DatabaseBuilder decimal(int size, int scale);


    DatabaseBuilder real4(int size, int scale);

    DatabaseBuilder real8(int size, int scale);

    DatabaseBuilder real4();

    DatabaseBuilder real8();

    DatabaseBuilder engine(String engine);

    DatabaseBuilder createCompoundIndex(String indexName, String... columns);

    DatabaseBuilder createCompoundUnique(String indexName, String... columns);

    DatabaseBuilder createCompoundPrimary(String... columns);

    List<String> buildSql();

    void build();

    List<TableMeta> buildTableMetas();

    DatabaseBuilder time();

    DatabaseBuilder year();

    DatabaseBuilder binary(int size);

    DatabaseBuilder varbinary(int size);

    DatabaseBuilder tinytext();

    DatabaseBuilder mediumtext();

    DatabaseBuilder mediumblob();

    DatabaseBuilder longblob();

    DatabaseBuilder bool();

    DatabaseBuilder longtext();

    DatabaseBuilder json();

    DatabaseBuilder enumString(String... values);

    DatabaseBuilder setString(String... values);

    DatabaseBuilder defaultValue(String defaultValue);

    DatabaseBuilder string(int size);


}
